package com.libraryManage.service.impl;

import com.libraryManage.commons.utils.PageUtil;
import com.libraryManage.commons.utils.ResponseEntity;
import com.libraryManage.entity.LoginLogDo;
import com.libraryManage.entity.ManagerDo;
import com.libraryManage.mapper.ManagerDoMapper;
import com.libraryManage.service.ManagerService;
import com.libraryManage.vo.ManagerVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author yf
 * @since 2020-10-22
 */
@Service
public class ManagerServiceImpl implements ManagerService {

    @Autowired
    ManagerDoMapper managerDoMapper;

    /**
     * 获取登录日志
     * @param
     * @return
     */
    @Override
    public ManagerDo getManagerById(String s) {
        return managerDoMapper.selectByPrimaryKey(s);
    }

    @Override
    public ResponseEntity<List<LoginLogDo>> getLogData(LoginLogDo loginLogDo) {
        PageUtil.startPage(loginLogDo);
        List<LoginLogDo> list = managerDoMapper.getLogData(loginLogDo);
        return PageUtil.tranferPage(list);
    }

}
